//
//  NFSRadioTableViewCell.m
//  NeedForSpeed
//
//  Created by 王国强 on 15/10/21.
//  Copyright © 2015年 Avenger. All rights reserved.
//

#import "NFSRadioTableViewCell.h"

#import "BaseHeader.h"

@implementation NFSRadioTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.program_titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 10,SCREEN_WIDTH - 10  , 40)];
        [self.contentView addSubview:self.program_titleLabel];
        
        self.program_join_numLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 50, SCREEN_WIDTH / 3, 20)];
        [self.contentView addSubview:self.program_join_numLabel];
        
        self.program_time_lengthLabel =[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH /3 , 50, SCREEN_WIDTH/3, 20)];
        [self.contentView addSubview:self.program_time_lengthLabel];
        
        self.prohram_file_sizeLabel = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH *2 /3 , 50, SCREEN_WIDTH /3 , 20)];
        [self.contentView addSubview:self.prohram_file_sizeLabel];
    }
    return self;
}

-(void)getModel:(NFSNextModel *)model
{
    if ([model.program_title isEqual:@""]) {
        [self.program_titleLabel setText:model.program_live_time];
    }
    else
    {
    [self.program_titleLabel setText:model.program_title];
    }
    [self.program_join_numLabel setText:[NSString stringWithFormat:@"%d", model.program_join_num.intValue]];
    [self.program_time_lengthLabel setText:model.program_time_length];
    [self.prohram_file_sizeLabel setText:model.program_file_size];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
